package com.example.demo.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Description
 * @Author wangzi
 * @Date 2019/4/30 16:32
 */
@Service
public class AsyncService {

    @Async
    public void soutString() throws InterruptedException {
        System.out.println("----------------------------- " + Thread.currentThread().getId());
    }

    @Async
    public void noAsync() throws InterruptedException {
        soutString();
        System.out.println("----------------------noasync" + Thread.currentThread().getId());
    }
}
